package uoc.ei.practica;

/**
 * Clase que representa una letra en el sistema
 *
 */
public class Letter extends IdentifiedObject {
	private int points;
	private int total;
	
	public Letter(String letter) {
		super(letter);
	}
	
	public Letter(String letter, int points, int total) {
		this(letter);
		set(points, total);
	}


	public void set(int points, int total) {
		this.points=points;
		this.total=total;
	}

	public boolean is(String letter) {
		return this.identifier.equals(letter);
	}


	public int count() {
		return this.total;
	}

	public String toString() {
		StringBuffer sb=new StringBuffer();
		sb.append(super.toString());
		sb.append("points: ").append(this.points).append(Messages.LS);
		sb.append("total: ").append(this.total).append(Messages.LS);
		
		return sb.toString();
	}
	public int getPoints()
	{
		return this.points;
	}
}
